<?php if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' ); ?>
<div class="rentform">
    <h3><a href="<?php echo base_url(); ?>">首页</a> &raquo; 发布出租信息</h3>
    <div class="tipbox">
        <?php echo validation_errors(); ?>
    </div>
    <?php echo form_open_multipart( my_url('publish', 'rentSubmit', '', false) ); ?>
    <table>
        <tr>
            <td colspan="2"><?php echo form_label('标题', 'title'); ?></td>
        </tr>
        <tr>
            <td colspan="2"><?php echo form_input(array('id' => 'title', 'name' => 'title', 'value' => set_value('title'), 'class' => 'txtbox txtlong')); ?></td>
        </tr>
        <tr>
            <td><?php echo form_label('所在区', 'zone'); ?></td>
            <td><?php echo form_label('所在地段', 'road'); ?><small>所在路名公寓名以及几座</small></td>
        </tr>
        <tr>
            <td>
            <?php
            echo form_dropdown('zone', $zoneData, set_value('zone'), 'class="select_box"');
            ?>
            </td>
            <td><?php echo form_input(array('id' => 'road', 'name' => 'road', 'value' => set_value('road'), 'class' => 'txtbox txtlong')); ?></td>
        </tr>
        <tr>
            <td><?php echo form_label('户型', 'room'); ?></td>
            <td><?php echo form_label('几楼', 'floor'); ?></td>
        </tr>
        <tr>
            <td>
            <?php
            echo form_dropdown('room', $roomData, set_value('room'), 'class="select_box"');
            ?>
            </td>
            <td><?php echo form_input(array('id' => 'floor', 'name' => 'floor', 'value' => set_value('floor'), 'class' => 'txtbox txtmin')); ?></td>
        </tr>
        <tr>
            <td><?php echo form_label('租金', 'amount'); ?></td>
            <td><?php echo form_label('个人/中介'); ?></td>
        </tr>
        <tr>
            <td><?php echo form_input(array('id' => 'amount', 'name' => 'amount', 'value' => set_value('amount'), 'class' => 'txtbox txtmin txtright')); ?> 元</td>
            <td>
                <?php
                $ispersonal = set_value('ispersonal');
                ?>
                <?php echo form_radio(array('id' => 'personal', 'name' => 'ispersonal', 'checked' => ($ispersonal === '' || $ispersonal) ? 'true' : '', 'value' => 1)); ?> 个人
                <?php echo form_radio(array('id' => 'personal', 'name' => 'ispersonal', 'checked' => ($ispersonal === '0') ? 'true' : '', 'value' => 0)); ?> 中介
            </td>
        </tr>
        <tr>
            <td><?php echo form_label('平方米', 'square'); ?></td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td><?php echo form_input(array('id' => 'square', 'name' => 'square', 'value' => set_value('square'), 'class' => 'txtbox txtmin txtright')); ?></td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td><?php echo form_label('详细描述', 'content'); ?></td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td colspan="2"><?php echo form_textarea('content', set_value('content'), 'class="txtbox tarea"' ); ?></td>
        </tr>
        <tr>
            <td colspan="2"><?php echo form_label('附加图片', 'image'); ?></td>
        </tr>
        <tr>
            <td colspan="2"><?php echo form_upload( array('id'=>'image', 'name' => 'image', 'class'=>'upload') ) ?></td>
        </tr>
    </table>
    <?php echo form_submit('submit', '发布', 'class="btn submitbtn"'); ?>
    <?php echo create_token(); ?>
    <?php echo form_close(); ?>
</div>
<div class="c"></div>
<?php init_kindeditor('content'); ?>